package com.swak.frame.extension;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import com.swak.frame.aware.SwakAwareProcessor;
import com.swak.frame.extension.repository.ExtensionRepository;
import com.swak.frame.logger.SwakLoggerFactory;

@Configuration(proxyBeanMethods = false)
@Order(10)
public class ExtensionAwareProcessor implements SwakAwareProcessor {

	private Logger logger = SwakLoggerFactory.getLogger(getClass());

	@Autowired
	public ExtensionRepository extensionRepository;

	@Override
	public void processor() {
		extensionRepository.getAllExtension().forEach((k, v) -> {
			logger.warn("[swak-ExtensionPoint] - ExtensionPoint Initialize info {}={},ExtPt={}",
					k.getBizScenarioUniqueIdentity(), v.getClass().getName(), k.getExtensionPointName());
		});
	}

}
